<!doctype html>
<html lang="zh-CN">
<head>

    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    
    <meta name="referrer" content="no-referrer-when-downgrade">
    

    <title>如何删除debug图标 | 早起的年轻人</title>
    <meta property="og:title" content="如何删除debug图标 - 早起的年轻人">
    <meta property="og:type" content="article">
        
    <meta property="article:published_time" content='2021-09-08T12:59:03&#43;08:00'>
        
        
    <meta property="article:modified_time" content='2021-09-08T12:59:03&#43;08:00'>
        
    <meta name="Keywords" content="Flutter，golang,go语言,go语言笔记,飞雪无情,java,android,博客,项目管理,python,软件架构,公众号,小程序">
    <meta name="description" content="如何删除debug图标">
        
    <meta name="author" content="luckly">
    <meta property="og:url" content="https://luckly.work/post/flutter_basic/%E5%A6%82%E4%BD%95%E5%88%A0%E9%99%A4debug%E5%9B%BE%E6%A0%87/">
    <link rel="shortcut icon" href='/favicon.ico'  type="image/x-icon">

    <link rel="stylesheet" href='/css/normalize.css'>
    <link rel="stylesheet" href='/css/style.css'>
    <script type="text/javascript" src="//cdn.bootcdn.net/ajax/libs/jquery/3.4.1/jquery.min.js"></script>

    
    
    
        <link href="https://cdn.bootcdn.net/ajax/libs/fancybox/3.5.7/jquery.fancybox.min.css" rel="stylesheet">
    
    
    
    
        <link rel="stylesheet" href='/css/douban.css'>
    
        <link rel="stylesheet" href='/css/other.css'>
    
</head>

<link rel="stylesheet"
      href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/11.2.0/styles/default.min.css">
<script src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/11.2.0/highlight.min.js"></script>
<body>
    <header id="header" class="clearfix">
    <div class="container">
        <div class="col-group">
            <div class="site-name ">
                
                    <a id="logo" href="https://luckly.work/">
                        早起的年轻人
                    </a>
                
                <p class="description">专注于Flutter、Android、Java、Go语言(golang)、移动互联网、项目管理、软件架构</p>
            </div>
            <div>
                <nav id="nav-menu" class="clearfix">
                    <a class="current" href="https://luckly.work/">首页</a>
                    
                    <a  href="https://luckly.work/categories/" title="分类">分类</a>
                    
                    <a  href="https://luckly.work/tags/" title="标签">标签</a>
                    
                    <a  href="https://luckly.work/archives/" title="归档">归档</a>
                    
                    <a  href="https://luckly.work/about/" title="关于我">关于我</a>
                    
                    <a  href="https://github.com/ITmxs/" title="github">github</a>
                    
                </nav>
            </div>
        </div>
    </div>
</header>

    <div id="body">
        <div class="container">
            <div class="col-group">

                <div class="col-8" id="main">
                    
<div class="res-cons">
    <style type="text/css">
    .post-toc {
        position: fixed;
        width: 200px;
        margin-left: -210px;
        padding: 5px 10px;
        font-family: Athelas, STHeiti, Microsoft Yahei, serif;
        font-size: 12px;
        border: 1px solid rgba(0, 0, 0, .07);
        border-radius: 5px;
        background-color: rgba(255, 255, 255, 0.98);
        background-clip: padding-box;
        -webkit-box-shadow: 1px 1px 2px rgba(0, 0, 0, .125);
        box-shadow: 1px 1px 2px rgba(0, 0, 0, .125);
        word-wrap: break-word;
        white-space: nowrap;
        -webkit-box-sizing: border-box;
        box-sizing: border-box;
        z-index: 999;
        cursor: pointer;
        max-height: 70%;
        overflow-y: auto;
        overflow-x: hidden;
    }

    .post-toc .post-toc-title {
        width: 100%;
        margin: 0 auto;
        font-size: 20px;
        font-weight: 400;
        text-transform: uppercase;
        text-align: center;
    }

    .post-toc .post-toc-content {
        font-size: 15px;
    }

    .post-toc .post-toc-content>nav>ul {
        margin: 10px 0;
    }

    .post-toc .post-toc-content ul {
        padding-left: 20px;
        list-style: square;
        margin: 0.5em;
        line-height: 1.8em;
    }

    .post-toc .post-toc-content ul ul {
        padding-left: 15px;
        display: none;
    }

    @media print,
    screen and (max-width:1057px) {
        .post-toc {
            display: none;
        }
    }
</style>
<div class="post-toc" style="position: absolute; top: 188px;">
    <h2 class="post-toc-title">文章目录</h2>
    <div class="post-toc-content">
        <nav id="TableOfContents">
  <ul>
    <li><a href="#示例-1使用-randomnextint-方法">示例 1：使用 Random().nextInt() 方法</a></li>
    <li><a href="#示例-2使用-randomnextdouble-和-floor-方法">示例 2：使用 Random.nextDouble() 和 floor() 方法</a></li>
  </ul>

  <ul>
    <li><a href="#使用-elevatedbutton--constrainedbox">使用 ElevatedButton + ConstrainedBox</a></li>
    <li><a href="#使用-elevatedbutton--container"><strong>使用 ElevatedButton</strong> + Container</a></li>
    <li><a href="#使用-materialbutton"><strong>使用 MaterialButton</strong></a></li>
    <li><a href="#使用-cliprrect--sizedbox--elevatedbutton"><strong>使用 ClipRRect + SizedBox + ElevatedButton</strong></a></li>
    <li><a href="#凸起按钮的旧方法"><strong>凸起按钮的旧方法</strong></a></li>
    <li><a href="#结论">结论</a></li>
  </ul>

  <ul>
    <li><a href="#步骤">步骤</a></li>
    <li><a href="#一个完整的例子">一个完整的例子</a></li>
  </ul>

  <ul>
    <li><a href="#问题"><strong>问题</strong></a></li>
    <li><a href="#解决方案"><strong>解决方案</strong></a></li>
  </ul>

  <ul>
    <li><a href="#视窗"><strong>视窗</strong></a></li>
    <li><a href="#苹果系统"><strong>苹果系统</strong></a></li>
    <li><a href="#接下来是什么">接下来是什么？</a></li>
  </ul>

  <ul>
    <li><a href="#flutter-中的实时电子邮件验证-1"><strong>Flutter 中的实时电子邮件验证</strong></a></li>
  </ul>

  <ul>
    <li><a href="#使用-jsondecode-和-jsonencode"><strong>使用 json.decode() 和 json.encode()</strong></a></li>
    <li><a href="#使用传播语法"><strong>使用传播语法</strong></a></li>
    <li><a href="#3-使用-from-方法"><strong>3. 使用 from() 方法</strong></a></li>
    <li><a href="#4-使用-addall"><strong>4. 使用 []..addAll()</strong></a></li>
  </ul>

  <ul>
    <li><a href="#示例-1使用多个-text-小部件">示例 1：使用多个 Text 小部件</a></li>
    <li><a href="#示例-2使用-richtext--textspan">示例 2：使用 RichText + TextSpan</a></li>
  </ul>

  <ul>
    <li><a href="#概述">概述</a></li>
    <li><a href="#完整示例">完整示例</a>
      <ul>
        <li><a href="#预览">预览</a></li>
        <li><a href="#编码">编码</a></li>
      </ul>
    </li>
    <li><a href="#结论-1">结论</a></li>
  </ul>

  <ul>
    <li><a href="#变更说明">变更说明</a></li>
    <li><a href="#迁移指南">迁移指南</a></li>
  </ul>

  <ul>
    <li><a href="#先决条件">先决条件</a></li>
    <li><a href="#应用预览">应用预览</a></li>
    <li><a href="#数据库结构">数据库结构</a></li>
    <li><a href="#编码-1">编码</a></li>
    <li><a href="#结论-2">结论</a></li>
  </ul>
</nav>
    </div>
</div>
<script type="text/javascript">
    $(document).ready(function () {
        var postToc = $(".post-toc");
        if (postToc.length) {
            var leftPos = $("#main").offset().left;
            if(leftPos<220){
                postToc.css({"width":leftPos-10,"margin-left":(0-leftPos)})
            }

            var t = postToc.offset().top - 20,
                a = {
                    start: {
                        position: "absolute",
                        top: t
                    },
                    process: {
                        position: "fixed",
                        top: 20
                    },
                };
            $(window).scroll(function () {
                var e = $(window).scrollTop();
                e < t ? postToc.css(a.start) : postToc.css(a.process)
            })
        }
    })
</script>
    <article class="post">
        <header>
            <h1 class="post-title">如何删除debug图标</h1>
        </header>
        <date class="post-meta meta-date">
            2021年9月8日
        </date>
        
        <div class="post-meta">
            <span>|</span>
            
            <span class="meta-category"><a href='/categories/Flutter'>Flutter</a></span>
            
            <span class="meta-category"><a href='/categories/dart'>dart</a></span>
            
        </div>
        
        
        <div class="post-meta">
            <span id="busuanzi_container_page_pv">|<span id="busuanzi_value_page_pv"></span><span>
                    阅读</span></span>
        </div>
        
        
        <div class="post-content">
            <p>从今天开始，将持续给大家带来一些flutter开发方面的技巧，</p>
<p>代码也会完全开源，只希望大家多多三连支持</p>
<h1 id="flutter如何删除模拟器上的-debug-横幅"><strong>Flutter：如何删除模拟器上的 DEBUG 横幅</strong></h1>
<p>本文将向您展示如何在使用 Flutter 时摆脱位于 iOS/Android 模拟器右上角的丑陋(仅是我个人的想法)调试横幅。</p>
<p>
        <a data-fancybox="gallery" href="https://luckly007.oss-cn-beijing.aliyuncs.com/image/Screen-Shot-2020-06-27-at-23.54.49.jpg">
            <img class="mx-auto" alt="img" src="https://luckly007.oss-cn-beijing.aliyuncs.com/image/Screen-Shot-2020-06-27-at-23.54.49.jpg" />
        </a>
    </p>
<p>解决方法很简单。您需要做的就是转到<strong>lib/main.dart</strong>文件并将<strong>MaterialApp</strong>类的<strong>debugShowCheckedModeBanner</strong>属性设置为<strong>false</strong>(默认设置为<strong>true</strong>)。</p>
<p>要将<strong>debugShowCheckedModeBanner</strong>设置为<strong>false</strong>，请添加以下行：</p>
<div class="highlight"><pre style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-dart" data-lang="dart">debugShowCheckedModeBanner: <span style="color:#66d9ef">false</span>,
</code></pre></div><p>例子：</p>
<div class="highlight"><pre style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-dart" data-lang="dart"><span style="color:#75715e">// other code
</span><span style="color:#75715e"></span><span style="color:#66d9ef">class</span> <span style="color:#a6e22e">MyApp</span> <span style="color:#66d9ef">extends</span> StatelessWidget {
  <span style="color:#960050;background-color:#1e0010">@</span>override
  Widget build(BuildContext context) {
    <span style="color:#66d9ef">return</span> MaterialApp(
      <span style="color:#75715e">// Hide the Debug banner
</span><span style="color:#75715e"></span>      debugShowCheckedModeBanner: <span style="color:#66d9ef">false</span>,
      title: <span style="color:#e6db74">&#39;Flutter Demo&#39;</span>,
      theme: ThemeData(
        primarySwatch: Colors.blue,
        visualDensity: VisualDensity.adaptivePlatformDensity,
      ),
      home: MyHomePage(title: <span style="color:#e6db74">&#39;Flutter Demo Home Page&#39;</span>),
    );
  }
}
<span style="color:#75715e">// other code
</span></code></pre></div><p>你学费了吗？</p>
<h1 id="flutterdart在最小值和最大值之间生成随机数"><strong>Flutter/Dart：在最小值和最大值之间生成随机数</strong></h1>
<p>在 Dart(以及 Flutter)中生成给定范围内的随机整数的几个示例。</p>
<h2 id="示例-1使用-randomnextint-方法">示例 1：使用 Random().nextInt() 方法</h2>
<p>编码：</p>
<pre><code>import 'dart:math';

randomGen(min, max) {
  // the nextInt method generate a non-ngegative random integer from 0 (inclusive) to max (exclusive)
  var x = Random().nextInt(max) + min;

  // If you don't want to return an integer, just remove the floor() method
  return x.floor();
}

void main() {
  int a = randomGen(1, 10);
  print(a);


}
</code></pre><p>输出：</p>
<pre><code>8 // you may get 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10)
</code></pre><p>您得到的结果可能包含最小值、最大值或此范围内的值。</p>
<h2 id="示例-2使用-randomnextdouble-和-floor-方法">示例 2：使用 Random.nextDouble() 和 floor() 方法</h2>
<p>编码：</p>
<pre><code>import 'dart:math';

randomGen(min, max) {
  // the nextDouble() method returns a random number between 0 (inclusive) and 1 (exclusive)
  var x = Random().nextDouble() * (max - min) + min;

  // If you don't want to return an integer, just remove the floor() method
  return x.floor();
}

// Testing
void main() {
  // with posstive min and max
  print(randomGen(10, 100));
  
  // with negative min 
  print(randomGen(-100, 0));
}
</code></pre><p>输出(当然，输出是随机的，每次重新执行代码时都会改变)。</p>
<pre><code>47
-69
</code></pre><p>您得到的结果可能包含 min 但从不包含 max。</p>
<h1 id="在-dart-中合并-2-个列表">在 Dart 中合并 2 个列表</h1>
<p>Dart的<strong>List</strong>类提供了<strong>addAll</strong>方法，可以帮助您轻松地将 2 个列表连接在一起；</p>
<p>例子：</p>
<pre><code>void main() {
  List listA = [1, 2, 3];
  List listB = [4, 5, 6];
  listA.addAll(listB);
  print(listA);
  
  List&lt;String&gt; listC = ['Dog', 'Cat'];
  List&lt;String&gt; listD = ['Bear', 'Tiger'];
  listC.addAll(listD);
  print(listC);
}
</code></pre><p>输出：</p>
<pre><code>[1, 2, 3, 4, 5, 6]
[Dog, Cat, Bear, Tiger]
</code></pre><h1 id="如何在-flutter-2021-中制作圆形按钮">如何在 Flutter (2021) 中制作圆形按钮</h1>
<p>按钮是移动应用程序中不可或缺的一部分。在 Flutter 中，按钮的形状默认为矩形。但是，在某些情况下，您可能希望您的按钮是圆形的，以最好地突出并融入周围的布局。</p>
<p>本文将向您展示一些在 Flutter 中创建圆形按钮(也称为圆形按钮)的优雅方法。</p>
<p>目录</p>
<p><a href="https://www.kindacode.com/article/how-to-make-circular-buttons-in-flutter/#Using_ElevatedButton_ConstrainedBox">使用 ElevatedButton + ConstrainedBox</a><a href="https://www.kindacode.com/article/how-to-make-circular-buttons-in-flutter/#Using_ElevatedButton_Container">使用 ElevatedButton + Container</a><a href="https://www.kindacode.com/article/how-to-make-circular-buttons-in-flutter/#Using_MaterialButton">使用 MaterialButton</a><a href="https://www.kindacode.com/article/how-to-make-circular-buttons-in-flutter/#Using_ClipRRect_SizedBox_ElevatedButton">使用 ClipRRect + SizedBox + ElevatedButton</a><a href="https://www.kindacode.com/article/how-to-make-circular-buttons-in-flutter/#An_Old_Method_for_RaisedButton">凸起按钮的旧方法</a><a href="https://www.kindacode.com/article/how-to-make-circular-buttons-in-flutter/#Conclusion">结论</a></p>
<h2 id="使用-elevatedbutton--constrainedbox">使用 ElevatedButton + ConstrainedBox</h2>
<p>预览：</p>
<p>1.00</p>
<p><!-- raw HTML omitted --><!-- raw HTML omitted --></p>
<p>编码：</p>
<pre><code>ConstrainedBox(
              constraints: BoxConstraints.tightFor(width: 200, height: 200),
              child: ElevatedButton(
                child: Text('Button', style: TextStyle(fontSize: 24),),
                onPressed: () {},
                style: ElevatedButton.styleFrom(
                  shape: CircleBorder(),
                ),
              ),
            ),
</code></pre><p>如果你想探索更多关于 ConstrainedBox 的信息，请查看这篇文章：<a href="https://www.kindacode.com/article/flutter-constrainedbox-tutorial-and-examples/">Flutter ConstrainedBox – 教程和示例</a>。</p>
<h2 id="使用-elevatedbutton--container"><strong>使用 ElevatedButton</strong> + Container</h2>
<p>编码：</p>
<pre><code>ElevatedButton(
        style: ElevatedButton.styleFrom(
           shape: CircleBorder(), 
           primary: Colors.red
        ),
        child: Container(
          width: 200,
          height: 200,
          alignment: Alignment.center,
          decoration: BoxDecoration(shape: BoxShape.circle),
          child: Text(
            'I am a button',
            style: TextStyle(fontSize: 24),
          ),
        ),
        onPressed: () {},
)
</code></pre><p>输出：</p>
<p>
        <a data-fancybox="gallery" href="https://luckly007.oss-cn-beijing.aliyuncs.com/image/Screen-Shot-2020-10-22-at-23.17.49.jpg">
            <img class="mx-auto" alt="img" src="https://luckly007.oss-cn-beijing.aliyuncs.com/image/Screen-Shot-2020-10-22-at-23.17.49.jpg" />
        </a>
    </p>
<h2 id="使用-materialbutton"><strong>使用 MaterialButton</strong></h2>
<p>编码：</p>
<pre><code>MaterialButton(
        color: Colors.blue,
        shape: CircleBorder(),
        onPressed: () {},
        child: Padding(
          padding: const EdgeInsets.all(100),
          child: Text(
            'A circle button',
            style: TextStyle(color: Colors.white, fontSize: 24),
          ),
        ),
)
</code></pre><p>输出：</p>
<p>
        <a data-fancybox="gallery" href="https://luckly007.oss-cn-beijing.aliyuncs.com/image/Screen-Shot-2020-10-22-at-23.23.22.jpg">
            <img class="mx-auto" alt="img" src="https://luckly007.oss-cn-beijing.aliyuncs.com/image/Screen-Shot-2020-10-22-at-23.23.22.jpg" />
        </a>
    </p>
<h2 id="使用-cliprrect--sizedbox--elevatedbutton"><strong>使用 ClipRRect + SizedBox + ElevatedButton</strong></h2>
<p>编码：</p>
<pre><code>ClipRRect(
            borderRadius: BorderRadius.circular(120),
            child: SizedBox(
              width: 240,
              height: 240,
              child: ElevatedButton.icon(
                icon: Icon(Icons.camera, size: 40,),
                label: Text('Camera', style: TextStyle(fontSize: 25),),
                onPressed: () {},
              ),
            ),
),
</code></pre><p>输出：</p>
<p>
        <a data-fancybox="gallery" href="https://luckly007.oss-cn-beijing.aliyuncs.com/image/Screen-Shot-2020-11-28-at-06.29.23.jpg">
            <img class="mx-auto" alt="img" src="https://luckly007.oss-cn-beijing.aliyuncs.com/image/Screen-Shot-2020-11-28-at-06.29.23.jpg" />
        </a>
    </p>
<h2 id="凸起按钮的旧方法"><strong>凸起按钮的旧方法</strong></h2>
<p>RaisedButton 小部件已弃用，仅出现在旧应用程序中。如果您正在处理一个新的 Flutter 项目，请改用 ElevatedButton。</p>
<p>将<strong>RaisedButton</strong>小部件包装在方形<strong>容器内</strong>并使用<strong>BorderRadius</strong>类。</p>
<p>示例代码：</p>
<pre><code>import 'package:flutter/material.dart';

void main() =&gt; runApp(MyApp());

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
        // Removing the debug banner when running on simulators
        debugShowCheckedModeBanner: false,
        title: 'An Aweasome App',
        home: Scaffold(
          appBar: AppBar(
            title: Text('Home'),
          ),
          body: Center(
            child: Column(
              children: &lt;Widget&gt;[
                // just an empty SizedBox to add some spacing
                SizedBox(height: 30,),

                Container(
                    // set width equal to height to make a square
                    width: 200,
                    height: 200,
                    child: RaisedButton(
                      color: Colors.orange,
                      shape: RoundedRectangleBorder(
                          // set the value to a very big number like 100, 1000...
                          borderRadius: BorderRadius.circular(100)),
                      child: Text('I am a button'),
                      onPressed: () {},
                    ))
              ],
            ),
          ),
        ));
  }
}
</code></pre><p>输出：</p>
<p>
        <a data-fancybox="gallery" href="https://luckly007.oss-cn-beijing.aliyuncs.com/image/Screen-Shot-2020-07-29-at-21.39.34.jpg">
            <img class="mx-auto" alt="img" src="https://luckly007.oss-cn-beijing.aliyuncs.com/image/Screen-Shot-2020-07-29-at-21.39.34.jpg" />
        </a>
    </p>
<h2 id="结论">结论</h2>
<p>我们研究了几种在 Flutter 中实现圆形按钮的方法。</p>
<h1 id="如何在-flutter-2021-中禁用横向模式">如何在 Flutter (2021) 中禁用横向模式</h1>
<p>本文将向您展示如何在 Flutter 中禁用横向模式。</p>
<p>
        <a data-fancybox="gallery" href="https://luckly007.oss-cn-beijing.aliyuncs.com/image/Screen-Shot-2020-08-10-at-18.09.56.jpg">
            <img class="mx-auto" alt="img" src="https://luckly007.oss-cn-beijing.aliyuncs.com/image/Screen-Shot-2020-08-10-at-18.09.56.jpg" />
        </a>
    </p>
<h2 id="步骤">步骤</h2>
<p>\1. 将<strong>服务</strong>库导入您的<strong>main.dart</strong>文件：</p>
<pre><code>import 'package:flutter/services.dart';
</code></pre><p>请注意，<strong>服务</strong>库随 Flutter 一起提供，您无需安装任何第三方插件。</p>
<p>\2. 将下面的代码片段添加到<strong>main.dart</strong>文件中的**main()**函数中：</p>
<pre><code>void main() {
  // add these lines
  WidgetsFlutterBinding.ensureInitialized();
  SystemChrome.setPreferredOrientations(
      [DeviceOrientation.portraitUp, DeviceOrientation.portraitDown]);

  ///////////// 
  runApp(MyApp());
}
</code></pre><p>\3. 重新启动您的应用程序(不使用<strong>热重载</strong>)并通过旋转 Android 和 iOS 模拟器检查结果。</p>
<h2 id="一个完整的例子">一个完整的例子</h2>
<p><strong>预览：</strong></p>
<p>1.00</p>
<p><!-- raw HTML omitted --><!-- raw HTML omitted --></p>
<p><strong>完整代码：</strong></p>
<pre><code>import 'package:flutter/material.dart';
import 'package:flutter/services.dart';

void main() {
  WidgetsFlutterBinding.ensureInitialized();
  SystemChrome.setPreferredOrientations(
      [DeviceOrientation.portraitUp, DeviceOrientation.portraitDown]);

  runApp(MyApp());
}

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      debugShowCheckedModeBanner: false,
      title: 'Kindacode.com',
      home: HomePage(),
    );
  }
}

class HomePage extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text('Kindacode.com'),
      ),
      body: Center(
        child: Text(
          'Hello',
          style: TextStyle(fontSize: 100),
        ),
      ),
    );
  }
}
</code></pre><p>如果您想根据设备方向显示不同的内容而不是禁用横向模式，</p>
<h1 id="flutter-错误无法解析包中的字符"><strong>Flutter 错误：无法解析包中的“字符”&hellip;</strong></h1>
<h2 id="问题"><strong>问题</strong></h2>
<p>运行 Flutter 应用程序时，您可能会看到以下错误消息：</p>
<pre><code>Could not resolve the package 'characters' in 'package:characters/characters.dart'
</code></pre><p>这通常发生在将 Flutter 升级到较新版本之后。</p>
<h2 id="解决方案"><strong>解决方案</strong></h2>
<p>为了修复上述错误，我只需通过执行以下命令升级<strong>pubspec.yaml</strong>文件中列出的所有依赖项：</p>
<pre><code>flutter pub upgrade
</code></pre><p>希望这可以帮助你。祝你有美好的一天
        <a data-fancybox="gallery" href="https://luckly007.oss-cn-beijing.aliyuncs.com/image/1f642.svg">
            <img class="mx-auto" alt="🙂" src="https://luckly007.oss-cn-beijing.aliyuncs.com/image/1f642.svg" />
        </a>
    </p>
<h1 id="windows-和-mac-上的-flutter-系统要求2021">Windows 和 Mac 上的 Flutter 系统要求(2021)</h1>
<p>Flutter 是 Google 创建的开源 UI SDK(软件开发工具包)。Flutter 于 2017 年首次推出并迅速发展，迄今为止在 Github 上拥有超过 11 万颗星，并被谷歌、阿里巴巴、宝马、房地产经纪人、Square 等许多大公司使用。</p>
<p>以下是 2021 年在 Windows 和 macOS 上安装和运行 Flutter 的系统要求。</p>
<h2 id="视窗"><strong>视窗</strong></h2>
<p><strong>最低要求：</strong></p>
<ul>
<li>操作系统：Windows 7 SP1 64 位、Windows 8.1 64 位、Windows 10 64 位</li>
<li>免费存储空间：1.32 GB</li>
<li>预装工具：
<ul>
<li>Windows PowerShell 5.0 或更新版本</li>
<li>git 2.x</li>
</ul>
</li>
</ul>
<p><strong>推荐规格</strong></p>
<p>构建过程消耗大量资源，尤其是 CPU。如果你的机器太旧，它会太热，你可能需要比平时付出更多的时间，并且在使用 Flutter 开发应用程序时会承受压力。</p>
<ul>
<li>操作系统：Windows 10 64 位</li>
<li>CPU：英特尔酷睿 i5-8400</li>
<li>内存：8 GB 内存</li>
<li>免费存储：5 GB SSD</li>
<li>工具：Windows PowerShell 5.0+、Git 2.x</li>
</ul>
<h2 id="苹果系统"><strong>苹果系统</strong></h2>
<p><strong>最低要求：</strong></p>
<ul>
<li>操作系统：macOS(64 位)</li>
<li>免费存储空间：2.8 GB</li>
<li>预装工具：bash、curl、git 2.x、mkdir、rm、unzip、which、zip</li>
</ul>
<p><strong>推荐要求：</strong></p>
<ul>
<li>操作系统：macOS 10.10 或更新版本</li>
<li>CPU：Intel Core i3-8100 或同等产品</li>
<li>内存：8 GB 内存</li>
<li>免费存储：5 GB SSD</li>
<li>预装工具：bash、curl、git 2.x、mkdir、rm、unzip、which、zip</li>
</ul>
<p>MacBook Pro 2017、Mac Mini 2018、MacBook Air 2020 或更好的 Mac 是不错的选择。</p>
<h2 id="接下来是什么">接下来是什么？</h2>
<p>Flutter 可帮助您使用单个代码库创建适用于 Android、iOS 和 Web 的应用程序。学习和使用 Flutter 也比其他移动应用程序制作技术更简单。</p>
<h1 id="flutter-中的实时电子邮件验证"><strong>Flutter 中的实时电子邮件验证</strong></h1>
<p>在本文中，我们将构建一个小型 Flutter 应用程序来演示如何在用户键入时验证电子邮件。</p>
<p>在本教程结束时运行代码时，您将看到以下内容：</p>
<p>1.00</p>
<p><!-- raw HTML omitted --><!-- raw HTML omitted --></p>
<h2 id="flutter-中的实时电子邮件验证-1"><strong>Flutter 中的实时电子邮件验证</strong></h2>
<p>1.<strong>创建一个全新的Flutter项目</strong></p>
<pre><code>flutter create email_validation_app
</code></pre><p><strong>2.安装<a href="https://pub.dev/packages/email_validator">email_validator</a>包</strong></p>
<p>将此添加到<strong>pubspec.yaml</strong>文件中的<strong>依赖项</strong>块：</p>
<pre><code>email_validator: '^1.0.5'
</code></pre><p>然后运行：</p>
<pre><code>flutter pub get 
</code></pre><p><strong>注意</strong>：如果您想在 Flutter 中使用正则表达式而不是第三方插件来验证电子邮件，请参阅<a href="https://www.kindacode.com/article/how-to-validate-email-in-flutter-without-plugins/">此</a><a href="https://www.kindacode.com/article/how-to-validate-email-in-flutter-without-plugins/">文章</a>。</p>
<p><strong>3. 打开您的 /lib/main.dart 文件，删除所有默认代码并添加以下内容</strong>：</p>
<pre><code>import 'package:flutter/material.dart';
import 'package:flutter/services.dart';

// import the email validator package
import 'package:email_validator/email_validator.dart';

void main() {
  runApp(MyApp());
}

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      // Hide the debug banner
      debugShowCheckedModeBanner: false,
      
      title: 'Flutter Tutorial',
      home: MyHomePage(),
    );
  }
}

class MyHomePage extends StatefulWidget {
  @override
  _MyHomePageState createState() =&gt; _MyHomePageState();
}

class _MyHomePageState extends State&lt;MyHomePage&gt; {
  final emailController = TextEditingController();

  // This message will be displayed under the email input
  String message = '';

  void validateEmail(String enteredEmail){
    if(EmailValidator.validate(enteredEmail)){
      setState(() {
        message = 'Your email seems nice!';
      });
    } else {
      setState(() {
        message = 'Please enter a valid email address!';
      });
    }
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
        appBar: AppBar(
          title: Text('Flutter Tutorial'),
        ),
        body: Container(
          padding: EdgeInsets.symmetric(vertical: 30, horizontal: 0),
          child: Column(children: [
            // Input email
            TextField(
              decoration: InputDecoration(labelText: 'Your Email'),
              keyboardType: TextInputType.emailAddress,
              controller: emailController,
              onChanged: (enteredEmail) =&gt; validateEmail(enteredEmail),
            ),

            // Just add some space
            SizedBox(height: 20),

            // Display the message
            Text(message)
          ]),
        ));
  }
}
</code></pre><p><strong>4. 试一试：</strong></p>
<pre><code>flutter run 
</code></pre><p>24页</p>
<h1 id="如何在-flutterdart-中克隆-list-或-map4-种方法">如何在 Flutter/Dart 中克隆 List 或 Map(4 种方法)</h1>
<p>
        <a data-fancybox="gallery" href="https://luckly007.oss-cn-beijing.aliyuncs.com/image/Flutter-1.png">
            <img class="mx-auto" alt="img" src="https://luckly007.oss-cn-beijing.aliyuncs.com/image/Flutter-1.png" />
        </a>
    </p>
<p>在 Dart 中有多种方法可以深度复制列表或地图。</p>
<p>目录</p>
<p><a href="https://www.kindacode.com/article/how-to-clone-a-list-or-map-in-dart-and-flutter/#Using_jsondecode_and_jsonencode">使用 json.decode() 和 json.encode()</a><a href="https://www.kindacode.com/article/how-to-clone-a-list-or-map-in-dart-and-flutter/#Using_the_spread_syntax">使用传播语法</a><a href="https://www.kindacode.com/article/how-to-clone-a-list-or-map-in-dart-and-flutter/#3_Using_the_from_method">3. 使用 from() 方法</a>[4. 使用 <a href="https://www.kindacode.com/article/how-to-clone-a-list-or-map-in-dart-and-flutter/#4_Using_addAll">]..addAll()</a></p>
<h2 id="使用-jsondecode-和-jsonencode"><strong>使用 json.decode() 和 json.encode()</strong></h2>
<p>这种方法适用于<strong>任何场景</strong>(嵌套列表、嵌套映射……)。您实际上可以在没有引用的情况下克隆多维列表和映射。</p>
<p>句法：</p>
<pre><code>List newList = json.decode(json.encode(oldList));
Map newMap = json.decode(json.encode(oldList));
</code></pre><p>例子：</p>
<pre><code>import 'dart:convert';
void main(){
  // Define a multi-dimensional map
  final Map oldMap = {
    &quot;name&quot; : {
      &quot;first&quot;: &quot;Joh&quot;,
      &quot;last&quot;: &quot;Doe&quot;
    },
    &quot;asset&quot; : {
      &quot;money&quot; : {
        &quot;bank&quot;: 1000,
        &quot;cash&quot;: 100
      },
      &quot;house&quot;: 1
    }
  };
  
  final Map newMap = json.decode(json.encode(oldMap));
  newMap[&quot;name&quot;][&quot;first&quot;] = &quot;Jesse&quot;;
  newMap[&quot;name&quot;][&quot;last&quot;] = &quot;Pinkman&quot;; 
  newMap[&quot;asset&quot;][&quot;money&quot;][&quot;cash&quot;] = 0; 
  
  
  print('oldMap: $oldMap');
  print('newMap: $newMap');
  
}
</code></pre><p>输出：</p>
<pre><code>oldMap: {name: {first: Joh, last: Doe}, asset: {money: {bank: 1000, cash: 100}, house: 1}}
newMap: {name: {first: Jesse, last: Pinkman}, asset: {money: {bank: 1000, cash: 0}, house: 1}}
</code></pre><h2 id="使用传播语法"><strong>使用传播语法</strong></h2>
<p>这种方法对于一维列表和地图来说既快速又有效。</p>
<p><strong>注意</strong>：此方法适用于一维 List 或 Map。要克隆多维**(嵌套) List 或 Map**，请使用**第一种方法**。</p>
<p>句法：</p>
<pre><code>List newList = [...oldList];
Map newMap = {...oldMap}
</code></pre><p>例子：</p>
<pre><code>void main(){
  // List
  final List myList = ['A', 'B', 'C', 'D'];
  
  final List clonedList = [...myList];
  clonedList[0] = 'Dog';
  
  print('myList: $myList');
  print('clonedList: $clonedList');
  
  // Map
  final Map myMap = {
    'name': 'John',
    'age': 37
  };
  
  final Map clonedMap = {...myMap};
  clonedMap[&quot;name&quot;] = &quot;Marry&quot;;
  clonedMap['age'] = 4; 
  
  print('myMap: $myMap');
  print('clonedMap: $clonedMap');
}
</code></pre><p>输出：</p>
<pre><code>myList: [A, B, C, D]
clonedList: [Dog, B, C, D]
myMap: {name: John, age: 37}
clonedMap: {name: Marry, age: 4}
</code></pre><h2 id="3-使用-from-方法"><strong>3. 使用 from() 方法</strong></h2>
<p>与第二种方法一样，这种方法对于一维列表和地图来说既快速又有效。</p>
<p><strong>注意</strong>：此方法适用于一维 List 或 Map。要深度复制<strong>多维(嵌套) List 或 Map</strong>，请使用<strong>第一种方法</strong>。</p>
<p>句法：</p>
<pre><code>List newList = List.from(oldList);
Map newMap = Map.from(oldMap);
</code></pre><h2 id="4-使用-addall"><strong>4. 使用 []..addAll()</strong></h2>
<p>这种方法仅适用于一维列表快速且有效。</p>
<p>句法：</p>
<pre><code>List newList  = []..addAll(oldList);
</code></pre><p>例子：</p>
<pre><code>void main(){
 List oldList = [1, 2, 3];
 List newList  = []..addAll(oldList);
 
 newList[2] = 100;
 print('oldList: $oldList');
  print('newList: $newList');
}
</code></pre><p>输出：</p>
<pre><code>oldList: [1, 2, 3]
newList: [1, 2, 100]
</code></pre><h1 id="在-flutter-中显示下标和上标">在 Flutter 中显示下标和上标</h1>
<p>在某些情况下，您可能希望在 Flutter 应用程序中显示一些下标和上标，例如数学公式、化学方程式或物理曲线。</p>
<p>要渲染下标，您可以像这样设置 Text 或 TextSpan 小部件的样式：</p>
<pre><code>TextStyle(
  fontFeatures: [FontFeature.subscripts()]),
  /* other styles go here */
),
</code></pre><p>要渲染上标，您可以像这样设置 Text 或 TextSpan 小部件的样式：</p>
<pre><code>TextStyle(
  fontFeatures: [FontFeature.superscripts()]),
  /* other styles go here */
),
</code></pre><p>为了更清楚，请参阅下面的示例。</p>
<h2 id="示例-1使用多个-text-小部件">示例 1：使用多个 Text 小部件</h2>
<p><strong>截屏：</strong></p>
<p>
        <a data-fancybox="gallery" href="https://luckly007.oss-cn-beijing.aliyuncs.com/image/Screen-Shot-2021-07-18-at-22.36.44.jpg">
            <img class="mx-auto" alt="img" src="https://luckly007.oss-cn-beijing.aliyuncs.com/image/Screen-Shot-2021-07-18-at-22.36.44.jpg" />
        </a>
    </p>
<p><strong>编码：</strong></p>
<pre><code>// Don't forget to import dart:ui into your code
Wrap(
              direction: Axis.horizontal,
              children: [
                Text('x'),
                Text(
                  '2',
                  style: TextStyle(fontFeatures: [FontFeature.superscripts()]),
                ),
                Text(' + '),
                Text('y'),
                Text(
                  '5',
                  style: TextStyle(fontFeatures: [FontFeature.superscripts()]),
                ),
                Text(' + '),
                Text('z'),
                Text(
                  'n',
                  style: TextStyle(fontFeatures: [FontFeature.superscripts()]),
                ),
              ],
            ),
</code></pre><h2 id="示例-2使用-richtext--textspan">示例 2：使用 RichText + TextSpan</h2>
<p><strong>截屏：</strong></p>
<p>
        <a data-fancybox="gallery" href="https://luckly007.oss-cn-beijing.aliyuncs.com/image/Screen-Shot-2021-07-18-at-22.38.47.jpg">
            <img class="mx-auto" alt="img" src="https://luckly007.oss-cn-beijing.aliyuncs.com/image/Screen-Shot-2021-07-18-at-22.38.47.jpg" />
        </a>
    </p>
<p><strong>完整的源代码：</strong></p>
<pre><code>// main.dart
import 'package:flutter/material.dart';
import 'dart:ui';

void main() {
  runApp(MyApp());
}

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
        // Remove the debug banner
        debugShowCheckedModeBanner: false,
        title: 'Kindacode.com',
        theme: ThemeData(
          primarySwatch: Colors.amber,
        ),
        home: HomePage());
  }
}

class HomePage extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
        appBar: AppBar(
          title: Text('Kindacode.com'),
        ),
        body: Padding(
          padding: EdgeInsets.all(30),
          child: RichText(
            text: TextSpan(children: [
              TextSpan(
                  text: 'Acid Sulfuric: ',
                  style: TextStyle(color: Colors.purple, fontSize: 30)),
              TextSpan(
                  text: 'H',
                  style: TextStyle(color: Colors.purple, fontSize: 30)),
              TextSpan(
                  text: '2',
                  style: TextStyle(
                      color: Colors.purple,
                      fontSize: 30,
                      fontFeatures: [FontFeature.subscripts()])),
              TextSpan(
                text: 'S',
                style: TextStyle(color: Colors.purple, fontSize: 30),
              ),
              TextSpan(
                text: 'O',
                style: TextStyle(color: Colors.purple, fontSize: 30),
              ),
              TextSpan(
                text: '4',
                style: TextStyle(
                    color: Colors.purple,
                    fontSize: 30,
                    fontFeatures: [FontFeature.subscripts()]),
              ),
            ]),
          ),
        ));
  }
}
</code></pre><h1 id="flutter自定义android系统导航栏"><strong>Flutter：自定义Android系统导航栏</strong></h1>
<p>
        <a data-fancybox="gallery" href="https://luckly007.oss-cn-beijing.aliyuncs.com/image/Screen-Shot-2021-07-11-at-17.17.37.jpg">
            <img class="mx-auto" alt="img" src="https://luckly007.oss-cn-beijing.aliyuncs.com/image/Screen-Shot-2021-07-11-at-17.17.37.jpg" />
        </a>
    </p>
<p>本文将向您展示如何在使用 Flutter 编写的 Android 应用程序中自定义系统导航栏，例如更改背景颜色和图标亮度，在应用程序运行时隐藏或显示导航栏。</p>
<p>目录</p>
<p><a href="https://www.kindacode.com/article/flutter-customize-the-android-system-navigation-bar/#Overview">概述</a><a href="https://www.kindacode.com/article/flutter-customize-the-android-system-navigation-bar/#The_Complete_Example">完整示例</a><a href="https://www.kindacode.com/article/flutter-customize-the-android-system-navigation-bar/#Preview">预览</a><a href="https://www.kindacode.com/article/flutter-customize-the-android-system-navigation-bar/#The_code">编码</a><a href="https://www.kindacode.com/article/flutter-customize-the-android-system-navigation-bar/#Conclusion">结论</a></p>
<h2 id="概述">概述</h2>
<p>Android 系统导航栏位于屏幕底部。它包含 3 个按钮来处理导航的关键方面：后退按钮、主页按钮和概览按钮(用于打开您最近使用过的应用程序和 Chrome 标签页的缩略图列表)。</p>
<p>一般情况下，系统导航栏有黑色背景色和浅色图标按钮：</p>
<p>
        <a data-fancybox="gallery" href="https://luckly007.oss-cn-beijing.aliyuncs.com/image/Screen-Shot-2021-07-11-at-17.11.32.jpg">
            <img class="mx-auto" alt="img" src="https://luckly007.oss-cn-beijing.aliyuncs.com/image/Screen-Shot-2021-07-11-at-17.11.32.jpg" />
        </a>
    </p>
<p>或带有深色图标的白色背景：</p>
<p>
        <a data-fancybox="gallery" href="https://luckly007.oss-cn-beijing.aliyuncs.com/image/Screen-Shot-2021-07-11-at-17.10.38.jpg">
            <img class="mx-auto" alt="img" src="https://luckly007.oss-cn-beijing.aliyuncs.com/image/Screen-Shot-2021-07-11-at-17.10.38.jpg" />
        </a>
    </p>
<p>在 Flutter 中，您可以使用<strong>SystemChrome</strong> API来控制系统栏。</p>
<ul>
<li><strong>setSystemUIOverlayStyle</strong>方法可用于指定用于可见的系统覆盖(如果有)的样式。</li>
<li><strong>setEnabledSystemUIOverlays</strong>方法可用于确定底部系统栏是否可见。</li>
</ul>
<p>为了更清楚，请参见下面的示例。</p>
<h2 id="完整示例">完整示例</h2>
<h3 id="预览">预览</h3>
<p>此示例应用程序有一个自定义底部导航栏，带有橙色背景颜色和灯光图标。屏幕中央有 2 个按钮。紫色的用于隐藏导航栏，绿色的用于显示导航栏。</p>
<p>这是它的工作原理：</p>
<p>1.00</p>
<p><!-- raw HTML omitted --><!-- raw HTML omitted --></p>
<h3 id="编码">编码</h3>
<p>不要忘记导入<strong>服务</strong>库：</p>
<pre><code>import 'package:flutter/services.dart';
</code></pre><p><strong>main.dart</strong>文件中的完整代码：</p>
<pre><code>// main.dart
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'dart:io';

void main() {
  runApp(MyApp());
}

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
        // Remove the debug banner
        debugShowCheckedModeBanner: false,
        title: 'Kindacode.com',
        theme: ThemeData(
          primarySwatch: Colors.green,
        ),
        home: HomePage());
  }
}

class HomePage extends StatefulWidget {
  const HomePage({Key? key}) : super(key: key);

  @override
  _HomePageState createState() =&gt; _HomePageState();
}

class _HomePageState extends State&lt;HomePage&gt; {
  @override
  void initState() {
    super.initState();
    if (Platform.isAndroid) {
      SystemChrome.setSystemUIOverlayStyle(SystemUiOverlayStyle(
          systemNavigationBarColor: Colors.deepOrange,
          systemNavigationBarIconBrightness: Brightness.light));
    }
  }

  void _hide() {
    // This will hide the bottom system navigation bar
    // Only the status bar on the top will show up
    SystemChrome.setEnabledSystemUIOverlays([SystemUiOverlay.top]);
  }

  void _show() {
    // This will show both the top status bar and the bottom navigation bar
    SystemChrome.setEnabledSystemUIOverlays(
        [SystemUiOverlay.top, SystemUiOverlay.bottom]);
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text('Kindacode.com'),
      ),
      body: Center(
        child: Row(
          mainAxisAlignment: MainAxisAlignment.spaceAround,
          children: [
            ElevatedButton(
              child: Text('Hide The System Bar'),
              onPressed: _hide,
              style: ElevatedButton.styleFrom(primary: Colors.purple),
            ),
            ElevatedButton(
              child: Text('Show The System Bar'),
              onPressed: _show,
            ),
          ],
        ),
      ),
    );
  }
}
</code></pre><h2 id="结论-1">结论</h2>
<p>您已经学习了如何在使用 Flutter 构建的 Android 应用程序中配置和控制系统导航栏。</p>
<h1 id="使用sqflite数据库时no-implementation-found-for-method-getdatabasespath-on-channel-comtekartiksqflite">使用sqflite数据库时No implementation found for method getDatabasesPath on channel com.tekartik.sqflite</h1>
<p>我终于找到了我的答案。<strong>我必须在 MainActivity 中添加 Sqflite 插件：<code>SqflitePlugin.registerWith(registrarFor(&quot;com.tekartik.sqflite.SqflitePlugin&quot;))</code></strong></p>
<p>我的 MainActivity 更改如下：</p>
<div class="highlight"><pre style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-dart" data-lang="dart"><span style="color:#66d9ef">import</span> android<span style="color:#960050;background-color:#1e0010">.</span>os<span style="color:#960050;background-color:#1e0010">.</span>Bundle
import io<span style="color:#960050;background-color:#1e0010">.</span>flutter<span style="color:#960050;background-color:#1e0010">.</span>app<span style="color:#960050;background-color:#1e0010">.</span>FlutterActivity
import io<span style="color:#960050;background-color:#1e0010">.</span>flutter<span style="color:#960050;background-color:#1e0010">.</span>plugins<span style="color:#960050;background-color:#1e0010">.</span>imagepicker<span style="color:#960050;background-color:#1e0010">.</span>ImagePickerPlugin
import com<span style="color:#960050;background-color:#1e0010">.</span>tekartik<span style="color:#960050;background-color:#1e0010">.</span>sqflite<span style="color:#960050;background-color:#1e0010">.</span>SqflitePlugin


class MainActivity <span style="color:#960050;background-color:#1e0010">:</span> FlutterActivity<span style="color:#960050;background-color:#1e0010">()</span> <span style="color:#960050;background-color:#1e0010">{</span>
    override fun onCreate<span style="color:#960050;background-color:#1e0010">(</span>savedInstanceState<span style="color:#960050;background-color:#1e0010">:</span> Bundle<span style="color:#960050;background-color:#1e0010">?)</span> <span style="color:#960050;background-color:#1e0010">{</span>
        super<span style="color:#960050;background-color:#1e0010">.</span>onCreate<span style="color:#960050;background-color:#1e0010">(</span>savedInstanceState<span style="color:#960050;background-color:#1e0010">)</span>
        ImagePickerPlugin<span style="color:#960050;background-color:#1e0010">.</span>registerWith<span style="color:#960050;background-color:#1e0010">(</span>
                registrarFor<span style="color:#960050;background-color:#1e0010">(</span><span style="color:#e6db74">&#34;io.flutter.plugins.imagepicker.ImagePickerPlugin&#34;</span><span style="color:#960050;background-color:#1e0010">))</span>
        SqflitePlugin<span style="color:#960050;background-color:#1e0010">.</span>registerWith<span style="color:#960050;background-color:#1e0010">(</span>registrarFor<span style="color:#960050;background-color:#1e0010">(</span><span style="color:#e6db74">&#34;com.tekartik.sqflite.SqflitePlugin&#34;</span><span style="color:#960050;background-color:#1e0010">))</span>

    <span style="color:#960050;background-color:#1e0010">}</span>

<span style="color:#960050;background-color:#1e0010">}</span>
</code></pre></div><h1 id="由-scaffoldmessenger-管理的-snackbars">由 ScaffoldMessenger 管理的 SnackBars</h1>
<h2 id="变更说明">变更说明</h2>
<p>先前的方法要求<code>Scaffold</code>显示<code>SnackBar</code>.</p>
<div class="highlight"><pre style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-dart" data-lang="dart">Scaffold(
  key: scaffoldKey,
  body: Builder(
    builder: (BuildContext context) {
      <span style="color:#66d9ef">return</span> GestureDetector(
        onTap: () {
          Scaffold.of(context).showSnackBar(SnackBar(
            content: <span style="color:#66d9ef">const</span> Text(<span style="color:#e6db74">&#39;snack&#39;</span>),
            duration: <span style="color:#66d9ef">const</span> Duration(seconds: <span style="color:#ae81ff">1</span>),
            action: SnackBarAction(
              label: <span style="color:#e6db74">&#39;ACTION&#39;</span>,
              onPressed: () { },
            ),
          ));
        },
        child: <span style="color:#66d9ef">const</span> Text(<span style="color:#e6db74">&#39;SHOW SNACK&#39;</span>),
      );
    },
  )
);
</code></pre></div><p>新方法要求<code>ScaffoldMessenger</code>显示<code>SnackBar</code>. 在这种情况下，<code>Builder</code>不再需要提供一个新的作用域，<code>BuildContext</code>它在<code>Scaffold</code>.</p>
<div class="highlight"><pre style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-dart" data-lang="dart">Scaffold(
  key: scaffoldKey,
  body: GestureDetector(
    onTap: () {
      ScaffoldMessenger.of(context).showSnackBar(SnackBar(
        content: <span style="color:#66d9ef">const</span> Text(<span style="color:#e6db74">&#39;snack&#39;</span>),
        duration: <span style="color:#66d9ef">const</span> Duration(seconds: <span style="color:#ae81ff">1</span>),
        action: SnackBarAction(
          label: <span style="color:#e6db74">&#39;ACTION&#39;</span>,
          onPressed: () { },
        ),
      ));
    },
    child: <span style="color:#66d9ef">const</span> Text(<span style="color:#e6db74">&#39;SHOW SNACK&#39;</span>),
  ),
);
</code></pre></div><p><code>SnackBar</code>在过渡期间呈现 a时，<code>SnackBar</code>完成一个<code>Hero</code>动画，平滑地移动到下一页。</p>
<p>在<code>ScaffoldMessenger</code>创建中，所有后代一个范围 <code>Scaffold</code>S寄存器接收<code>SnackBar</code>s，这是他们在这些转变是如何坚持。当使用由<code>ScaffoldMessenger</code>提供 的根时<code>MaterialApp</code>，所有后代<code>Scaffold</code>s 都会接收<code>SnackBar</code>s，除非<code>ScaffoldMessenger</code>在树的更下方创建新的作用域。通过实例化您自己的<code>ScaffoldMessenger</code>，您可以控制哪些<code>Scaffold</code>s 接收<code>SnackBar</code>s，哪些不基于您的应用程序的上下文。</p>
<p>该方法<code>debugCheckHasScaffoldMessenger</code>可用于断言给定的上下文具有<code>ScaffoldMessenger</code>祖先。尝试在<code>SnackBar</code>没有<code>ScaffoldMessenger</code>祖先的情况下呈现 a 会导致如下断言：</p>
<div class="highlight"><pre style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-dart" data-lang="dart">No ScaffoldMessenger widget found.
Scaffold widgets require a ScaffoldMessenger widget ancestor.
Typically, the ScaffoldMessenger widget <span style="color:#66d9ef">is</span> introduced by the MaterialApp
at the top of your application widget tree.
</code></pre></div><h2 id="迁移指南">迁移指南</h2>
<p>迁移前的代码：</p>
<div class="highlight"><pre style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-dart" data-lang="dart"><span style="color:#75715e">// The ScaffoldState of the current context was used for managing SnackBars.
</span><span style="color:#75715e"></span>Scaffold.of(context).showSnackBar(mySnackBar);
Scaffold.of(context).hideCurrentSnackBar(mySnackBar);
Scaffold.of(context).removeCurrentSnackBar(mySnackBar);

<span style="color:#75715e">// If a Scaffold.key is specified, the ScaffoldState can be directly
</span><span style="color:#75715e">// accessed without first obtaining it from a BuildContext via
</span><span style="color:#75715e">// Scaffold.of. From the key, use the GlobalKey.currentState
</span><span style="color:#75715e">// getter. This was previously used to manage SnackBars.
</span><span style="color:#75715e"></span><span style="color:#66d9ef">final</span> GlobalKey<span style="color:#f92672">&lt;</span>ScaffoldState<span style="color:#f92672">&gt;</span> scaffoldKey <span style="color:#f92672">=</span> GlobalKey<span style="color:#f92672">&lt;</span>ScaffoldState<span style="color:#f92672">&gt;</span>();
Scaffold(
  key: scaffoldKey,
  body: ...,
);

scaffoldKey.currentState.showSnackBar(mySnackBar);
scaffoldKey.currentState.hideCurrentSnackBar(mySnackBar);
scaffoldKey.currentState.removeCurrentSnackBar(mySnackBar);
</code></pre></div><p>迁移后的代码：</p>
<div class="highlight"><pre style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-dart" data-lang="dart"><span style="color:#75715e">// The ScaffoldMessengerState of the current context is used for managing SnackBars.
</span><span style="color:#75715e"></span>ScaffoldMessenger.of(context).showSnackBar(mySnackBar);
ScaffoldMessenger.of(context).hideCurrentSnackBar(mySnackBar);
ScaffoldMessenger.of(context).removeCurrentSnackBar(mySnackBar);

<span style="color:#75715e">// If a ScaffoldMessenger.key is specified, the ScaffoldMessengerState can be directly
</span><span style="color:#75715e">// accessed without first obtaining it from a BuildContext via
</span><span style="color:#75715e">// ScaffoldMessenger.of. From the key, use the GlobalKey.currentState
</span><span style="color:#75715e">// getter. This is used to manage SnackBars.
</span><span style="color:#75715e"></span><span style="color:#66d9ef">final</span> GlobalKey<span style="color:#f92672">&lt;</span>ScaffoldMessengerState<span style="color:#f92672">&gt;</span> scaffoldMessengerKey <span style="color:#f92672">=</span> GlobalKey<span style="color:#f92672">&lt;</span>ScaffoldMessengerState<span style="color:#f92672">&gt;</span>();
ScaffoldMessenger(
  key: scaffoldMessengerKey,
  child: ...
)

scaffoldMessengerKey.currentState.showSnackBar(mySnackBar);
scaffoldMessengerKey.currentState.hideCurrentSnackBar(mySnackBar);
scaffoldMessengerKey.currentState.removeCurrentSnackBar(mySnackBar);

<span style="color:#75715e">// The root ScaffoldMessenger can also be accessed by providing a key to 
</span><span style="color:#75715e">// MaterialApp.scaffoldMessengerKey. This way, the ScaffoldMessengerState can be directly accessed
</span><span style="color:#75715e">// without first obtaining it from a BuildContext via ScaffoldMessenger.of. From the key, use
</span><span style="color:#75715e">// the GlobalKey.currentState getter.
</span><span style="color:#75715e"></span><span style="color:#66d9ef">final</span> GlobalKey<span style="color:#f92672">&lt;</span>ScaffoldMessengerState<span style="color:#f92672">&gt;</span> rootScaffoldMessengerKey <span style="color:#f92672">=</span> GlobalKey<span style="color:#f92672">&lt;</span>ScaffoldMessengerState<span style="color:#f92672">&gt;</span>();
MaterialApp(
  scaffoldMessengerKey: rootScaffoldMessengerKey,
  home: ...
)

rootScaffoldMessengerKey.currentState.showSnackBar(mySnackBar);
rootScaffoldMessengerKey.currentState.hideCurrentSnackBar(mySnackBar);
rootScaffoldMessengerKey.currentState.removeCurrentSnackBar(mySnackBar);
</code></pre></div><p>要经常看的https://flutter.dev/docs/release/breaking-changes</p>
<h1 id="flutter-和-sqlitecrud-示例2021">Flutter 和 SQLite：CRUD 示例(2021)</h1>
<p>
        <a data-fancybox="gallery" href="https://luckly007.oss-cn-beijing.aliyuncs.com/image/Flutter-SQLite.jpg">
            <img class="mx-auto" alt="img" src="https://luckly007.oss-cn-beijing.aliyuncs.com/image/Flutter-SQLite.jpg" />
        </a>
    </p>
<p>SQLite 是一种快速关系数据库，可用于为移动应用程序离线存储数据。CRUD 表示创建、读取、更新和删除，这是持久化存储的四个基本操作。</p>
<p>在本文中，我们将构建一个使用 SQLite 持久化数据的小型 Flutter 应用程序。</p>
<h2 id="先决条件">先决条件</h2>
<p>为了完全理解这个例子，你应该：</p>
<ul>
<li>Flutter 基础知识</li>
<li>知道什么是 SQLite。如果没有，请先查看<a href="https://www.sqlite.org/index.html">官方文档</a>。</li>
<li>一台安装了 Flutter 的电脑，一个代码编辑器(VS Code 很棒)。</li>
</ul>
<h2 id="应用预览">应用预览</h2>
<p>我们将要制作的应用程序是一个离线日记，可以让用户记录他们白天所做的活动。为简单起见，我们将这些活动中的每一个都称为“日志”或“项目”。</p>
<p>在本教程的范围内，“活动”、“项目”和“日记”可以互换。</p>
<p>该应用程序有一个浮动按钮，可用于显示底部工作表。该底部工作表包含 2 个对应于“标题”和“描述”的文本字段。这些文本字段用于创建新的“项目”或更新现有的“项目”。</p>
<p>保存的“项目”从 SQLite 数据库中获取并以列表视图显示。每个“项目”都有一个更新按钮和一个删除按钮。</p>
<p>一个演示胜过千言万语：</p>
<p>1.00</p>
<p><!-- raw HTML omitted --><!-- raw HTML omitted --></p>
<h2 id="数据库结构">数据库结构</h2>
<p>我们将创建一个名为<strong>kindacode.db</strong>的 SQLite 数据库。它只有一个名为<strong>items 的</strong>表。下面是表的结构：</p>
<table>
<thead>
<tr>
<th>柱子</th>
<th>类型</th>
<th>描述</th>
</tr>
</thead>
<tbody>
<tr>
<td>ID</td>
<td>整数</td>
<td>一个活动的id</td>
</tr>
<tr>
<td>标题</td>
<td>文本</td>
<td>活动名称</td>
</tr>
<tr>
<td>描述</td>
<td>文本</td>
<td>活动详情</td>
</tr>
<tr>
<td>创建于</td>
<td>时间戳</td>
<td>项目的创建时间。它将由 SQLite 自动添加</td>
</tr>
</tbody>
</table>
<h2 id="编码-1">编码</h2>
<p>\1. 创建一个新的 Flutter 项目。在<strong>lib</strong>文件夹中，添加一个名为<strong>sql_helper.dart</strong>的新文件。</p>
<p>项目结构：</p>
<pre><code>.
├── main.dart
└── sql_helper.dart
</code></pre><p>安装<a href="https://pub.dev/packages/sqflite/install">sqflite</a>插件(注意名字有一个“f”)：</p>
<pre><code>flutter pub add sqflite
</code></pre><p>\2. <strong>sql_helper.dar</strong> t 中的完整代码：</p>
<pre><code>import 'package:sqflite/sqflite.dart' as sql;

class SQLHelper {
  static Future&lt;void&gt; createTables(sql.Database database) async {
    await database.execute(&quot;&quot;&quot;CREATE TABLE items(
        id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,
        title TEXT,
        description TEXT,
        createdAt TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP
      )
      &quot;&quot;&quot;);
  }
// id: the id of a item
// title, description: name and description of your activity
// created_at: the time that the item was created. It will be automatically handled by SQLite

  static Future&lt;sql.Database&gt; db() async {
    return sql.openDatabase(
      'kindacode.db',
      version: 1,
      onCreate: (sql.Database database, int version) async {
        await createTables(database);
      },
    );
  }

  // Create new item (journal)
  static Future&lt;int&gt; createItem(String title, String? descrption) async {
    final db = await SQLHelper.db();

    final data = {'title': title, 'description': descrption};
    final id = await db.insert('items', data,
        conflictAlgorithm: sql.ConflictAlgorithm.replace);
    return id;
  }

  // Read all items (journals)
  static Future&lt;List&lt;Map&lt;String, dynamic&gt;&gt;&gt; getItems() async {
    final db = await SQLHelper.db();
    return db.query('items', orderBy: &quot;id&quot;);
  }

  // Read a single item by id
  // The app doesn't use this method but I put here in case you want to see it
  static Future&lt;List&lt;Map&lt;String, dynamic&gt;&gt;&gt; getItem(int id) async {
    final db = await SQLHelper.db();
    return db.query('items', where: &quot;id = ?&quot;, whereArgs: [id], limit: 1);
  }

  // Update an item by id
  static Future&lt;int&gt; updateItem(
      int id, String title, String? descrption) async {
    final db = await SQLHelper.db();

    final data = {
      'title': title,
      'description': descrption,
      'createdAt': DateTime.now().toString()
    };

    final result =
        await db.update('items', data, where: &quot;id = ?&quot;, whereArgs: [id]);
    return result;
  }

  // Delete
  static Future&lt;void&gt; deleteItem(int id) async {
    final db = await SQLHelper.db();
    try {
      await db.delete(&quot;items&quot;, where: &quot;id = ?&quot;, whereArgs: [id]);
    } catch (err) {
      print(&quot;Something went wrong when deleting an item: $err&quot;);
    }
  }
}
</code></pre><p>\3. <strong>main.dart 中的</strong>完整代码：</p>
<pre><code>// main.dart
import 'package:flutter/material.dart';

import 'sql_helper.dart';

void main() {
  runApp(MyApp());
}

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
        // Remove the debug banner
        debugShowCheckedModeBanner: false,
        title: 'Kindacode.com',
        theme: ThemeData(
          primarySwatch: Colors.orange,
        ),
        home: HomePage());
  }
}

class HomePage extends StatefulWidget {
  const HomePage({Key? key}) : super(key: key);

  @override
  _HomePageState createState() =&gt; _HomePageState();
}

class _HomePageState extends State&lt;HomePage&gt; {
  // All journals
  List&lt;Map&lt;String, dynamic&gt;&gt; _journals = [];

  bool _isLoading = true;
  // This function is used to fetch all data from the database
  void _refreshJournals() async {
    final data = await SQLHelper.getItems();
    setState(() {
      _journals = data;
      _isLoading = false;
    });
  }

  @override
  void initState() {
    super.initState();
    _refreshJournals(); // Loading the diary when the app starts
  }

  TextEditingController _titleController = new TextEditingController();
  TextEditingController _descriptionController = new TextEditingController();

  // This function will be triggered when the floating button is pressed
  // It will also be triggered when you want to update an item
  void _showForm(int? id) async {
    if (id != null) {
      // id == null -&gt; create new item
      // id != null -&gt; update an existing item
      final existingJournal =
          _journals.firstWhere((element) =&gt; element['id'] == id);
      _titleController.text = existingJournal['title'];
      _descriptionController.text = existingJournal['description'];
    }

    showModalBottomSheet(
        context: context,
        elevation: 5,
        builder: (_) =&gt; Container(
              padding: EdgeInsets.all(15),
              width: double.infinity,
              height: 300,
              child: Column(
                crossAxisAlignment: CrossAxisAlignment.end,
                children: [
                  TextField(
                    controller: _titleController,
                    decoration: InputDecoration(hintText: 'Title'),
                  ),
                  SizedBox(
                    height: 10,
                  ),
                  TextField(
                    controller: _descriptionController,
                    decoration: InputDecoration(hintText: 'Description'),
                  ),
                  SizedBox(
                    height: 20,
                  ),
                  ElevatedButton(
                    onPressed: () async {
                      // Save new journal
                      if (id == null) {
                        await _addItem();
                      }

                      if (id != null) {
                        await _updateItem(id);
                      }

                      // Clear the text fields
                      _titleController.text = '';
                      _descriptionController.text = '';

                      // Close the bottom sheet
                      Navigator.of(context).pop();
                    },
                    child: Text(id == null ? 'Create New' : 'Update'),
                  )
                ],
              ),
            ));
  }

// Insert a new journal to the database
  Future&lt;void&gt; _addItem() async {
    await SQLHelper.createItem(
        _titleController.text, _descriptionController.text);
    _refreshJournals();
  }

  // Update an existing journal
  Future&lt;void&gt; _updateItem(int id) async {
    await SQLHelper.updateItem(
        id, _titleController.text, _descriptionController.text);
    _refreshJournals();
  }

  // Delete an item
  void _deleteItem(int id) async {
    await SQLHelper.deleteItem(id);
    ScaffoldMessenger.of(context).showSnackBar(SnackBar(
      content: Text('Successfully deleted a journal!'),
    ));
    _refreshJournals();
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text('Kindacode.com'),
      ),
      body: _isLoading
          ? Center(
              child: CircularProgressIndicator(),
            )
          : ListView.builder(
              itemCount: _journals.length,
              itemBuilder: (context, index) =&gt; Card(
                color: Colors.orange[200],
                margin: EdgeInsets.all(15),
                child: ListTile(
                    title: Text(_journals[index]['title']),
                    subtitle: Text(_journals[index]['description']),
                    trailing: SizedBox(
                      width: 100,
                      child: Row(
                        children: [
                          IconButton(
                            icon: Icon(Icons.edit),
                            onPressed: () =&gt; _showForm(_journals[index]['id']),
                          ),
                          IconButton(
                            icon: Icon(Icons.delete),
                            onPressed: () =&gt;
                                _deleteItem(_journals[index]['id']),
                          ),
                        ],
                      ),
                    )),
              ),
            ),
      floatingActionButton: FloatingActionButton(
        child: Icon(Icons.add),
        onPressed: () =&gt; _showForm(null),
      ),
    );
  }
}
</code></pre><h2 id="结论-2">结论</h2>
<p>您已经学习了 SQLite 的基础知识，并了解了在 Flutter 应用程序中使用 SQLite 的端到端示例。从这里，您可以构建更复杂的应用程序，离线存储大量数据。</p>

        </div>

        
<div class="post-archive">
    <ul class="post-copyright">
        <li><strong>原文作者：</strong><a rel="author" href="https://luckly.work/">luckly</a></li>
        <li style="word-break:break-all"><strong>原文链接：</strong><a href="https://luckly.work/post/flutter_basic/%E5%A6%82%E4%BD%95%E5%88%A0%E9%99%A4debug%E5%9B%BE%E6%A0%87/">https://luckly.work/post/flutter_basic/%E5%A6%82%E4%BD%95%E5%88%A0%E9%99%A4debug%E5%9B%BE%E6%A0%87/</a></li>
        <li><strong>版权声明：</strong>本作品采用<a rel="license" href="https://creativecommons.org/licenses/by-nc-nd/4.0/">知识共享署名-非商业性使用-禁止演绎 4.0 国际许可协议</a>进行许可，非商业转载请注明出处（作者，原文链接），商业转载请联系作者获得授权。</li>
    </ul>
</div>
<br/>



        

<div class="post-archive">
    <h2>See Also</h2>
    <ul class="listing">
        
        <li><a href="/post/flutter_basic/%E4%BF%9D%E6%8C%81%E9%A1%B5%E9%9D%A2%E7%8A%B6%E6%80%81/">保持页面状态</a></li>
        
        <li><a href="/post/flutter_package/Flutter%E6%B5%81%E7%95%85%E5%BA%A6%E4%BC%98%E5%8C%96%E7%BB%84%E4%BB%B6Keframe/">Flutter流畅度优化组件Keframe</a></li>
        
        <li><a href="/post/flutter_basic/Flutter_AnimatedList%E6%95%99%E7%A8%8B%E5%92%8C%E7%A4%BA%E4%BE%8B/">Flutter_AnimatedList–教程和示例</a></li>
        
        <li><a href="/post/flutter_basic/Flutter%E5%A6%82%E4%BD%95%E7%9D%80%E8%89%B2%E8%B0%83%E8%AF%95%E6%8E%A7%E5%88%B6%E5%8F%B0%E6%97%A5%E5%BF%97/">Flutter：如何着色调试控制台日志</a></li>
        
        <li><a href="/post/flutter_basic/Dart%E6%A3%80%E6%9F%A5%E5%9C%B0%E5%9B%BE%E6%98%AF%E5%90%A6%E4%B8%BA%E7%A9%BA/">Dart检查map是否为空</a></li>
        
    </ul>
</div>


        <div class="post-meta meta-tags">
            
            <ul class="clearfix">
                
                <li><a href='/tags/Flutter'>Flutter</a></li>
                
                <li><a href='/tags/dart'>dart</a></li>
                
            </ul>
            
        </div>
    </article>
    
    

    
    
    <div class="post bg-white">
      <script src="https://utteranc.es/client.js"
            repo= "https://github.com/ITmxs/repo"
            issue-term="pathname"
            theme="github-light"
            crossorigin="anonymous"
            async>
      </script>
    </div>
    
</div>

                    <footer id="footer">
    <div>
        &copy; 2021 <a href="https://luckly.work/">早起的年轻人 By luckly</a>
        
        | <a rel="nofollow" target="_blank" href="http://beian.miit.gov.cn/">粤ICP备2021号-1</a>
        
    </div>
    <br />
    <div>
        <div class="github-badge">
            <a href="https://juejin.cn/user/3843548384077192" target="_black" rel="nofollow"><span class="badge-subject">Powered by</span><span class="badge-value bg-blue">掘金</span></a>
        </div>
        <div class="github-badge">
            <a href="https://space.bilibili.com/480883651" target="_black"><span class="badge-subject">Design by</span><span class="badge-value bg-brightgreen">早起的年轻人</span></a>
        </div>
        <div class="github-badge">
            <a href="https://cloud.tencent.com/developer/user/6702670" target="_black"><span class="badge-subject">Theme</span><span class="badge-value bg-yellowgreen">云社区</span></a>
        </div>
    </div>
</footer>


    
    <script type="text/javascript">
        window.MathJax = {
            tex2jax: {
                inlineMath: [['$', '$']],
                processEscapes: true
                }
            };
    </script>
    <script src='https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js?config=TeX-MML-AM_CHTML' async></script><script src="https://cdn.bootcdn.net/ajax/libs/fancybox/3.5.7/jquery.fancybox.min.js"></script>

<a id="rocket" href="#top"></a>
<script type="text/javascript" src='/js/totop.js?v=0.0.0' async=""></script>



    <script type="text/javascript" src="//busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js" async></script>




    <script src='/js/douban.js'></script>
    <script src="/js/copy-to-clipboard.js"></script>

                </div>

                <div id="secondary">
    <section class="widget">
        <form id="search" action='https://luckly.work/search/' method="get" accept-charset="utf-8" target="_blank" _lpchecked="1">
      
      <input type="text" name="q" maxlength="20" placeholder="Search">
      <input type="hidden" name="sitesearch" value="https://luckly.work/">
      <button type="submit" class="submit icon-search"></button>
</form>
    </section>
    
    <section class="widget">
        <h3 class="widget-title">最近文章</h3>
<ul class="widget-list">
    
    <li>
        <a href="https://luckly.work/post/nginx/nginx%E6%96%87%E4%BB%B6%E5%86%85%E5%AE%B9/" title="Nginx文件内容">Nginx文件内容</a>
    </li>
    
    <li>
        <a href="https://luckly.work/post/nginx/nginx%E6%9E%81%E7%AE%80%E6%95%99%E7%A8%8B/" title="Nginx极简教程">Nginx极简教程</a>
    </li>
    
    <li>
        <a href="https://luckly.work/post/nginx/%E5%8D%81%E5%88%86%E9%92%9F%E5%85%A5%E9%97%A8nginx/" title="十分钟入门Nginx">十分钟入门Nginx</a>
    </li>
    
    <li>
        <a href="https://luckly.work/post/go/Goland%E8%BF%9C%E7%A8%8B%E5%BC%80%E5%8F%91%E9%85%8D%E7%BD%AE/" title="Goland远程开发配置">Goland远程开发配置</a>
    </li>
    
    <li>
        <a href="https://luckly.work/post/%E8%AF%BB%E4%B9%A6/%E5%9F%9F%E5%90%8D%E8%A7%A3%E6%9E%90/" title="域名解析">域名解析</a>
    </li>
    
    <li>
        <a href="https://luckly.work/post/git/%E6%8F%90%E4%BA%A4%E8%BF%87%E7%A8%8B%E7%9C%81%E7%95%A5%E6%9F%90%E4%BA%9B%E6%96%87%E4%BB%B6/" title="提交过程省略某些文件">提交过程省略某些文件</a>
    </li>
    
    <li>
        <a href="https://luckly.work/post/flutter_tips/Flutter_DropdownButton%E7%A4%BA%E4%BE%8B/" title="Flutter_DropdownButton示例">Flutter_DropdownButton示例</a>
    </li>
    
    <li>
        <a href="https://luckly.work/post/flutter_tips/Flutter_ExpansionPanelList%E5%92%8CExpansionPanelList.radio%E7%A4%BA%E4%BE%8B/" title="Flutter_ExpansionPanelList和ExpansionPanelList">Flutter_ExpansionPanelList和ExpansionPanelList</a>
    </li>
    
    <li>
        <a href="https://luckly.work/post/flutter_tips/Flutter%E5%BE%AE%E4%BF%A1%E5%88%86%E4%BA%AB%E9%93%BE%E6%8E%A5%E8%B7%B3%E5%9B%9EApp%E6%8C%87%E5%AE%9A%E9%A1%B5%E9%9D%A2/" title="Flutter微信分享链接跳回App指定页面">Flutter微信分享链接跳回App指定页面</a>
    </li>
    
    <li>
        <a href="https://luckly.work/post/%E4%BF%A1%E6%81%AF%E7%B3%BB%E7%BB%9F/%E5%A4%96%E5%8C%85%E5%8F%AF%E8%83%BD%E7%9A%84%E9%97%AE%E9%A2%98/" title="外包可能的问题">外包可能的问题</a>
    </li>
    
</ul>
    </section>

    

    <section class="widget">
        <h3 class="widget-title"><a href='/categories/'>分类</a></h3>
<ul class="widget-list">
    
    <li><a href="https://luckly.work/categories/Flutter/">Flutter (326)</a></li>
    
    <li><a href="https://luckly.work/categories/IT/">IT (2)</a></li>
    
    <li><a href="https://luckly.work/categories/Kotlin/">Kotlin (2)</a></li>
    
    <li><a href="https://luckly.work/categories/Mysql/">Mysql (1)</a></li>
    
    <li><a href="https://luckly.work/categories/nginx/">nginx (1)</a></li>
    
    <li><a href="https://luckly.work/categories/Vue/">Vue (6)</a></li>
    
    <li><a href="https://luckly.work/categories/YouTube%E8%A7%86%E9%A2%91%E4%B8%8B%E8%BD%BD/">YouTube视频下载 (1)</a></li>
    
    <li><a href="https://luckly.work/categories/android/">android (6)</a></li>
    
    <li><a href="https://luckly.work/categories/dart/">dart (96)</a></li>
    
    <li><a href="https://luckly.work/categories/Flutter/">Flutter (28)</a></li>
    
    <li><a href="https://luckly.work/categories/gin/">gin (25)</a></li>
    
    <li><a href="https://luckly.work/categories/git/">git (4)</a></li>
    
    <li><a href="https://luckly.work/categories/Go/">Go (102)</a></li>
    
    <li><a href="https://luckly.work/categories/gorm/">gorm (4)</a></li>
    
    <li><a href="https://luckly.work/categories/grpc/">grpc (1)</a></li>
    
    <li><a href="https://luckly.work/categories/html/">html (3)</a></li>
    
    <li><a href="https://luckly.work/categories/ios/">ios (1)</a></li>
    
    <li><a href="https://luckly.work/categories/linux/">linux (1)</a></li>
    
    <li><a href="https://luckly.work/categories/nginx/">nginx (6)</a></li>
    
    <li><a href="https://luckly.work/categories/python/">python (35)</a></li>
    
    <li><a href="https://luckly.work/categories/read/">读书笔记 (6)</a></li>
    
    <li><a href="https://luckly.work/categories/redis/">redis (2)</a></li>
    
    <li><a href="https://luckly.work/categories/%E4%B8%AA%E4%BA%BA%E8%B5%84%E6%96%99/">个人资料 (1)</a></li>
    
    <li><a href="https://luckly.work/categories/%E4%B9%A6%E5%8D%95/">书单 (8)</a></li>
    
    <li><a href="https://luckly.work/categories/%E4%B9%A6%E8%AF%84/">书评 (1)</a></li>
    
    <li><a href="https://luckly.work/categories/%E4%BF%A1%E6%81%AF%E7%B3%BB%E7%BB%9F%E7%AE%A1%E7%90%86%E5%B8%88/">信息系统管理师 (19)</a></li>
    
    <li><a href="https://luckly.work/categories/%E4%BF%A1%E6%81%AF%E7%B3%BB%E7%BB%9F%E9%A1%B9%E7%9B%AE%E7%AE%A1%E7%90%86%E5%B8%88/">信息系统项目管理师 (25)</a></li>
    
    <li><a href="https://luckly.work/categories/%E5%8E%9F%E5%88%99/">原则 (1)</a></li>
    
    <li><a href="https://luckly.work/categories/%E5%8E%9F%E7%94%9F%E9%80%9A%E8%AE%AF/">原生通讯 (1)</a></li>
    
    <li><a href="https://luckly.work/categories/%E5%9F%BA%E7%A1%80/">基础 (1)</a></li>
    
    <li><a href="https://luckly.work/categories/%E5%A4%8D%E5%88%A9%E6%95%88%E5%BA%94/">复利效应 (1)</a></li>
    
    <li><a href="https://luckly.work/categories/%E5%AE%89%E8%A3%85%E6%95%99%E7%A8%8B/">安装教程 (1)</a></li>
    
    <li><a href="https://luckly.work/categories/%E5%B0%91%E6%9C%89%E4%BA%BA%E8%B5%B0%E7%9A%84%E8%B7%AF/">少有人走的路 (1)</a></li>
    
    <li><a href="https://luckly.work/categories/%E5%BF%83%E8%AF%AD/">心语 (3)</a></li>
    
    <li><a href="https://luckly.work/categories/%E6%8F%92%E4%BB%B6/">插件 (2)</a></li>
    
    <li><a href="https://luckly.work/categories/%E6%95%99%E5%AD%A6/">教学 (1)</a></li>
    
    <li><a href="https://luckly.work/categories/%E7%8E%8B%E9%98%B3%E6%98%8E/">王阳明 (3)</a></li>
    
    <li><a href="https://luckly.work/categories/%E7%94%B5%E5%AD%90%E4%B9%A6/">电子书 (1)</a></li>
    
    <li><a href="https://luckly.work/categories/%E7%99%BB%E9%99%86%E8%A1%A8%E5%8D%95/">登陆表单 (1)</a></li>
    
    <li><a href="https://luckly.work/categories/%E7%A8%BB%E7%9B%9B%E5%92%8C%E5%A4%AB/">稻盛和夫 (1)</a></li>
    
    <li><a href="https://luckly.work/categories/%E7%A9%B7%E7%88%B8%E7%88%B8%E5%AF%8C%E7%88%B8%E7%88%B8/">穷爸爸富爸爸 (1)</a></li>
    
    <li><a href="https://luckly.work/categories/%E7%B2%BE%E8%BF%9B/">精进 (3)</a></li>
    
    <li><a href="https://luckly.work/categories/%E7%BC%96%E7%A8%8B/">编程 (1)</a></li>
    
    <li><a href="https://luckly.work/categories/%E8%99%9A%E5%B9%BB/">虚幻 (1)</a></li>
    
    <li><a href="https://luckly.work/categories/%E8%B4%A2%E5%8A%A1%E8%87%AA%E7%94%B1%E4%B9%8B%E8%B7%AF/">财务自由之路 (2)</a></li>
    
    <li><a href="https://luckly.work/categories/%E8%B7%91%E6%AD%A5/">跑步 (1)</a></li>
    
    <li><a href="https://luckly.work/categories/%E8%B7%AF%E7%94%B1%E4%BC%A0%E5%8F%82/">路由传参 (1)</a></li>
    
    <li><a href="https://luckly.work/categories/%E8%B7%AF%E7%BA%BF/">路线 (1)</a></li>
    
    <li><a href="https://luckly.work/categories/%E8%BD%AF%E4%BB%B6%E5%AE%9E%E6%96%BD/">软件实施 (1)</a></li>
    
    <li><a href="https://luckly.work/categories/%E9%98%B3%E6%98%8E%E5%BF%83%E5%AD%A6/">阳明心学 (3)</a></li>
    
    <li><a href="https://luckly.work/categories/%E9%A1%B9%E7%9B%AE/">项目 (1)</a></li>
    
    <li><a href="https://luckly.work/categories/%E9%AD%85%E5%8A%9B/">魅力 (1)</a></li>
    
</ul>
    </section>

    <section class="widget">
        <h3 class="widget-title"><a href='/tags/'>标签</a></h3>
<div class="tagcloud">
    
    <a href="https://luckly.work/tags/flutter/">flutter</a>
    
    <a href="https://luckly.work/tags/IT/">IT</a>
    
    <a href="https://luckly.work/tags/Kotlin/">Kotlin</a>
    
    <a href="https://luckly.work/tags/Mysql/">Mysql</a>
    
    <a href="https://luckly.work/tags/nginx/">nginx</a>
    
    <a href="https://luckly.work/tags/Vue/">Vue</a>
    
    <a href="https://luckly.work/tags/YouTube%E8%A7%86%E9%A2%91%E4%B8%8B%E8%BD%BD/">YouTube视频下载</a>
    
    <a href="https://luckly.work/tags/android/">android</a>
    
    <a href="https://luckly.work/tags/dart/">dart</a>
    
    <a href="https://luckly.work/tags/flutter/">flutter</a>
    
    <a href="https://luckly.work/tags/gin/">gin</a>
    
    <a href="https://luckly.work/tags/git/">git</a>
    
    <a href="https://luckly.work/tags/go/">go</a>
    
    <a href="https://luckly.work/tags/gorm/">gorm</a>
    
    <a href="https://luckly.work/tags/grpc/">grpc</a>
    
    <a href="https://luckly.work/tags/html/">html</a>
    
    <a href="https://luckly.work/tags/ios/">ios</a>
    
    <a href="https://luckly.work/tags/linux/">linux</a>
    
    <a href="https://luckly.work/tags/nginx/">nginx</a>
    
    <a href="https://luckly.work/tags/python/">python</a>
    
    <a href="https://luckly.work/tags/redis/">redis</a>
    
    <a href="https://luckly.work/tags/%E4%B8%AA%E4%BA%BA%E8%B5%84%E6%96%99/">个人资料</a>
    
    <a href="https://luckly.work/tags/%E4%B9%A6%E5%8D%95/">书单</a>
    
    <a href="https://luckly.work/tags/%E4%B9%A6%E8%AF%84/">书评</a>
    
    <a href="https://luckly.work/tags/%E4%BF%A1%E6%81%AF%E7%B3%BB%E7%BB%9F%E7%AE%A1%E7%90%86%E5%B8%88/">信息系统管理师</a>
    
    <a href="https://luckly.work/tags/%E4%BF%A1%E6%81%AF%E7%B3%BB%E7%BB%9F%E9%A1%B9%E7%9B%AE%E7%AE%A1%E7%90%86%E5%B8%88/">信息系统项目管理师</a>
    
    <a href="https://luckly.work/tags/%E5%85%A5%E9%97%A8/">入门</a>
    
    <a href="https://luckly.work/tags/%E5%8E%9F%E5%88%99/">原则</a>
    
    <a href="https://luckly.work/tags/%E5%8E%9F%E7%94%9F%E9%80%9A%E8%AE%AF/">原生通讯</a>
    
    <a href="https://luckly.work/tags/%E5%9F%BA%E7%A1%80/">基础</a>
    
    <a href="https://luckly.work/tags/%E5%A4%8D%E5%88%A9%E6%95%88%E5%BA%94/">复利效应</a>
    
    <a href="https://luckly.work/tags/%E5%AE%89%E8%A3%85%E6%95%99%E7%A8%8B/">安装教程</a>
    
    <a href="https://luckly.work/tags/%E5%B0%91%E6%9C%89%E4%BA%BA%E8%B5%B0%E7%9A%84%E8%B7%AF/">少有人走的路</a>
    
    <a href="https://luckly.work/tags/%E5%BF%83%E8%AF%AD/">心语</a>
    
    <a href="https://luckly.work/tags/%E6%8F%92%E4%BB%B6/">插件</a>
    
    <a href="https://luckly.work/tags/%E6%95%99%E5%AD%A6/">教学</a>
    
    <a href="https://luckly.work/tags/%E7%8E%8B%E9%98%B3%E6%98%8E/">王阳明</a>
    
    <a href="https://luckly.work/tags/%E7%94%B5%E5%AD%90%E4%B9%A6/">电子书</a>
    
    <a href="https://luckly.work/tags/%E7%99%BB%E9%99%86%E8%A1%A8%E5%8D%95/">登陆表单</a>
    
    <a href="https://luckly.work/tags/%E7%A8%BB%E7%9B%9B%E5%92%8C%E5%A4%AB/">稻盛和夫</a>
    
    <a href="https://luckly.work/tags/%E7%A9%B7%E7%88%B8%E7%88%B8%E5%AF%8C%E7%88%B8%E7%88%B8/">穷爸爸富爸爸</a>
    
    <a href="https://luckly.work/tags/%E7%B2%BE%E8%BF%9B/">精进</a>
    
    <a href="https://luckly.work/tags/%E7%BC%96%E7%A8%8B/">编程</a>
    
    <a href="https://luckly.work/tags/%E8%99%9A%E5%B9%BB/">虚幻</a>
    
    <a href="https://luckly.work/tags/%E8%AF%97/">诗</a>
    
    <a href="https://luckly.work/tags/%E8%AF%BB%E4%B9%A6%E7%AC%94%E8%AE%B0/">读书笔记</a>
    
    <a href="https://luckly.work/tags/%E8%B4%A2%E5%8A%A1%E8%87%AA%E7%94%B1%E4%B9%8B%E8%B7%AF/">财务自由之路</a>
    
    <a href="https://luckly.work/tags/%E8%B7%91%E6%AD%A5/">跑步</a>
    
    <a href="https://luckly.work/tags/%E8%B7%AF%E7%94%B1%E4%BC%A0%E5%8F%82/">路由传参</a>
    
    <a href="https://luckly.work/tags/%E8%B7%AF%E7%BA%BF/">路线</a>
    
    <a href="https://luckly.work/tags/%E8%BD%AF%E4%BB%B6%E5%AE%9E%E6%96%BD/">软件实施</a>
    
    <a href="https://luckly.work/tags/%E9%80%9A%E8%AE%AF%E5%BD%95/">通讯录</a>
    
    <a href="https://luckly.work/tags/%E9%98%B3%E6%98%8E%E5%BF%83%E5%AD%A6/">阳明心学</a>
    
    <a href="https://luckly.work/tags/%E9%A1%B9%E7%9B%AE/">项目</a>
    
    <a href="https://luckly.work/tags/%E9%AD%85%E5%8A%9B/">魅力</a>
    
</div>
    </section>

    
<section class="widget">
    <h3 class="widget-title">友情链接</h3>
    <ul class="widget-list">
        
        <li>
            <a target="_blank" href="http://www.topgoer.com/" title="枯藤">枯藤</a>
        </li>
        
        <li>
            <a target="_blank" href="https://gorm.cn/zh_CN/docs/index.html" title="gorm">gorm</a>
        </li>
        
        <li>
            <a target="_blank" href="https://docs.python.org/zh-cn/3/tutorial/index.html" title="python">python</a>
        </li>
        
        <li>
            <a target="_blank" href="https://www.liwenzhou.com/" title="李文周">李文周的博客</a>
        </li>
        
        <li>
            <a target="_blank" href="http://www.xbzweb.com/" title="小包子的博客">小包子的博客</a>
        </li>
        
        <li>
            <a target="_blank" href="https://www.flysnow.org/" title="飞雪无情的博客">飞雪无情的博客</a>
        </li>
        
        <li>
            <a target="_blank" href="https://sliverhorn.com/" title="sliverhorn的博客">sliverhorn的博客</a>
        </li>
        
        <li>
            <a target="_blank" href="http://yuedu.baidu.com/ebook/14a722970740be1e640e9a3e" title="Android Gradle权威指南">Android Gradle权威指南</a>
        </li>
        
        <li>
            <a target="_blank" href="https://gesdh.cn/" title="小格子">格子导航</a>
        </li>
        
        <li>
            <a target="_blank" href="https://itachi.xyz/" title="阿林">itachi&#39;s Blog</a>
        </li>
        
        <li>
            <a target="_blank" href="https://darjun.github.io/" title="大俊">大俊Blog</a>
        </li>
        
        <li>
            <a target="_blank" href="https://geektutu.com/post/quick-golang.html" title="极客兔兔">极客兔兔Blog</a>
        </li>
        
        <li>
            <a target="_blank" href="http://zxfcumtcs.github.io/" title="赵雪峰">雪峰Blog</a>
        </li>
        
    </ul>
</section>


    <section class="widget">
        <h3 class="widget-title">其它</h3>
        <ul class="widget-list">
            <li><a href="https://luckly.work/index.xml">文章 RSS</a></li>
        </ul>
    </section>
</div>
            </div>
        </div>
    </div>
</body>

</html>